package com.bao.system.mapper;

import com.bao.system.entity.Menu;
import com.bao.vo.MenuVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * 菜单表 Mapper 接口
 * </p>
 *
 * @author bao
 * @since 2021-06-03
 */
@Mapper
@Repository
public interface MenuMapper extends BaseMapper<Menu> {

    @Select("select u.menu_id  from tb_department_menu u where u.department_id = #{id}")
    int[] getMenuNumberList(Integer id);

    @Select("select t.id, t.parentId, t.menuName, t.url, t.icon, t.children from tb_menu t where id = #{i} and parent_id = '0'")
    MenuVO getTopMenuList(int i);
}
